package practice4;

import java.util.Scanner;

public class P2680 {
    public static void main(String[] args) {
        int big = 1189;
        int small = 841;
        Scanner sc = new Scanner(System.in);
        String size = sc.next();
        int num = Integer.parseInt(size.substring(1, 2));
        for(int i=0;i<num;i++){
            big/=2;
            if(big<small){
                int tmp=big;
                big=small;
                small=tmp;
            }
        }
        System.out.println(big);
        System.out.println(small);
    }
}
